<?php

require_once('configuration/pdo/IPdoConfig.class.php');

abstract class AbstractPdoConfig implements IPdoConfig {
	
	private static $tables = array(
		TBL_USER,
		TBL_VOTE,
		TBL_TOPIC, TBL_OFFERED_TOPIC, TBL_NEEDED_TOPIC,
		TBL_CATEGORY, TBL_OFFERED_CATEGORY, TBL_NEEDED_CATEGORY
	);
	public function getTableNames() {
		return AbstractPdoConfig::$tables;
	}

	public final function newPDO() {
		$db = $this->_newPDO();
		$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
		return $db;
	}
	
	protected abstract function _newPDO();
	
}

?>